package com.csw.util;

import java.util.Random;

public class NumberUtil {

    //给定一个字符串
    static String str = "0123456789";

    public static String getNum6() {

        StringBuffer salt = new StringBuffer();
            for (int i = 0; i < 6; i++) {
                salt.append(str.charAt(new Random().nextInt(10)));
            }
            return salt.toString();

    }

    public static String getNum10() {

        StringBuffer salt = new StringBuffer();
            for (int i = 0; i < 10; i++) {
                salt.append(str.charAt(new Random().nextInt(10)));
            }
            return salt.toString();

    }

}

